<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div>
            <!-- 知识点【1】：过滤器除了能接受单引号（''）括起来的参数外，也支持接受在 vm 实例中绑定的数据， -->
            <!-- 称之为动态参数。 -->
            {{html_data | datem("sky",test_data)}}
        </div>
    </div>
    <script type="text/javascript" src="../../../../commonJS/vue.js"></script>
    <script type="text/javascript" src="../../../../commonJS/zepto-1.2.0.js"></script>
    <!-- <script type="text/javascript" src="../../../../commonJS/moment.js"></script> -->
    <!-- <script type="text/javascript" src="../../../../commonJS/common.js"></script> -->
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                html_data: "过滤器",
                test_data: 22
            },
            filters: {
                datem: function datem(value, param, param2) {
                    console.log(value);
                    console.log(param);
                    console.log(param2);
                    // 形参设置为2个，但是实参仅仅1个我们就能拿到两个值
                    if (value == "过滤器") {
                        return "过滤器编写成功1"
                    }
                }
            },
            methods: {

            }
        });
    </script>
</body>